#include "libutilsbase.h"
#include "windows.h"
#include "wincon.h"
LIB_NS_BEGIN

///Concrete Console listener.
class LIBAPI UConsole 
{
public:
#ifdef WIN32
	enum TEXT_COLOR
	{
		TEXT_BLUE	=	FOREGROUND_BLUE,
		TEXT_GREEN	=	FOREGROUND_GREEN,
		TEXT_RED	=	FOREGROUND_RED,
		TEXT_YELLOW	=	FOREGROUND_GREEN | FOREGROUND_RED,
		TEXT_NORMAL	=	FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED ,//white
		TEXT_HIGHT	=	FOREGROUND_INTENSITY
	};

	static void SetTextStyle(TEXT_COLOR value, bool bHight)
	{
		SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),value | (bHight ? FOREGROUND_INTENSITY : 0)); 
	}	
#else
#define TEXT_BLUE	"\033[36;1m"
#define TEXT_GREEN	"\033[32;1m"
#define TEXT_RED	"\033[31;1m"
#define TEXT_YELLOW "\033[93;1m"
#define TEXT_NORMAL "\033[0m"
#define TEXT_HIGHT	"\033[" "1m"
	static void SetTextStyle(const TCHAR* value, bool bHight)
	{
		printf("%s%s",value, bHight ? TEXT_HIGHT:"");
	}
#endif


	


public:
	static void RestoreTextStyle();
	static void Print(TEXT_COLOR type,const std::string& value);
	static void Print(TEXT_COLOR type,const std::wstring& value);
};


LIB_NS_END